package com.baidu.shoppingmall.attribute.dao;

import com.baidu.shoppingmall.attribute.domain.AttributeCategoryPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @author Administrator
 */
@Mapper
public interface AttributeCategoryDao extends BaseMapper<AttributeCategoryPO> {

    /**
     * 获取所有的属性以及类别
     * @return list
     */
    @Select("select ca.attribute_name,ca.attribute_subitem,cc.category_name from \n" +
            "commodity_attribute ca\n" +
            "join commodity_attribute_category_relationship car\n" +
            "on ca.id=car.attribute_id\n" +
            "join commodity_category cc\n" +
            "on cc.id=car.category_id")
    List<AttributeCategoryPO> getCategoryProperties();
}
